package com.mhtube.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mhtube.mappers.VideoMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("videoController")
public class VideoController {
    @Resource
    private VideoMapper videoMapper;

    @RequestMapping("/testOneToOne")
    public JSONObject test(String videoId) {
        return JSON.parseObject(JSON.toJSONString(videoMapper.selectByVideoIdWithUser(videoId).getUser()));
    }
}
